package com.xoa.controller.party;


import com.xoa.model.party.EnConstructionSite;
import com.xoa.service.party.EnConstructionSiteService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 在建工地
 * Created by gsb on 2018/1/6.
 */
@Controller
@RequestMapping("/enConstructionSite")
public class EnConstructionSiteController {

    @Resource
    private EnConstructionSiteService enConstructionSiteService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 上午10:10:51
     * 类介绍  :   新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EnConstructionSite> insertSelective(EnConstructionSite enConstructionSite, HttpServletRequest request, String gridLocation){
        return enConstructionSiteService.insertSelective(enConstructionSite,request,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 上午10:10:51
     * 类介绍  :   删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EnConstructionSite> deleteByPrimaryKey(Integer sid){
        return enConstructionSiteService.deleteByPrimaryKey(sid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 上午10:18:51
     * 类介绍  :   修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EnConstructionSite> updateByPrimaryKeySelective(EnConstructionSite enConstructionSite, HttpServletRequest request, String gridLocation){
        return enConstructionSiteService.updateByPrimaryKeySelective(enConstructionSite, request,gridLocation);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 上午10:25:51
     * 类介绍  :   详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EnConstructionSite> selectById(Integer sid){
        return enConstructionSiteService.selectById(sid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 上午10:30:51
     * 类介绍  :   列表  或 导出 也可条件查询
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EnConstructionSite> queryList(EnConstructionSite enConstructionSite, Integer page, Integer pageSize,
                                                boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return enConstructionSiteService.queryList(enConstructionSite, page, pageSize, useFlag, request, response, export);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-5 下午16:25:51
     * 类介绍  :   导入
     * 构造参数:
     *
     */
    @RequestMapping(value ="importEnConstructionSite")
    @ResponseBody
    public ToJson<EnConstructionSite> importEnConstructionSite(MultipartFile file, HttpServletResponse response,
                                                               HttpServletRequest request, HttpSession session) {
        return enConstructionSiteService.importEnConstructionSite(file, response, request, session);
    }
    }
